/**
 * This project is a database of food additives, denoted code
 * E.
 * 
 * Copyright (C) 2010  Dmitry Zolotaryov
 *
 * This program is free software: you can redistribute it
 * and/or modify it under the terms of the GNU General Public
 * License as published by the Free Software Foundation,
 * either version 3 of the License, or (at your option) any
 * later version.
 *
 * This program is distributed in the hope that it will be
 * useful, but WITHOUT ANY WARRANTY; without even the implied
 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
 * PURPOSE.  See the GNU General Public License for more
 * details.
 *
 * You should have received a copy of the GNU General Public
 * License along with this program.  If not, see
 * http://www.gnu.org/licenses/.
 * 
 * Contact the author:
 * e-mail: zdv2010@gmail.com
 * ICQ: 476-467-654
 * Jabber: c0unt_zer0@jabber.org
 */
package zdv.foodadditives;

/**
 * This class implements the model records in database.<br>
 *  
 * @author Dmitry Zolotaryov
 */

public final class MyItem {
/**
 * The constants associated with the risk.
 */
	public final class Danger {
		public static final int SUSPICIOUS     = 1;
		public static final int DANGEROUS      = 2;
		public static final int VERY_DANGEROUS = 3;
		
		public Danger(){}
	}
	
/**
 * The constants that describe the types of additives
 */
	public final class Categories {
		public static final int PRESERVATIVE   = 1;
		public static final int COLORANT       = 2;
		public static final int ANTIOXIDANT    = 3;
		public static final int STABILIZER     = 4;
		public static final int REGULATOR      = 5;
		public static final int FLAVOR         = 6;
		public static final int ANTIBIOTIC     = 7;
		public static final int ANTIFOAM_AGENT = 8;
		
		public Categories(){};
	}

	private String code;
	private int categorie;
	private int danger;
	private String name;
	private String name_ru;
	private String description;
	private String description_ru;
	
	/**
	 * Constructor
	 * @param name
	 * @param name_ru
	 * @param categorie
	 * @param danger
	 * @param description
	 * @param description_ru
	 * @param code 
	 */
	public MyItem(String name, String name_ru, int categorie, int danger,
			String description, String description_ru, String code){
		this.name = name.trim();
		this.name_ru = name_ru.trim();
		this.categorie = categorie;
		this.danger = danger;
		this.description = description.trim();
		this.description_ru = description_ru.trim();
		this.code = code.trim().toLowerCase();
	}
	/**
	 * @param code the code to set
	 */
	public void setCode(String code) {
		this.code = code.trim().toLowerCase();
	}
	/**
	 * @return the code
	 */
	public String getCode() {
		return code;
	}
	/**
	 * @param categorie the categorie to set
	 */
	public void setCategorie(int categorie) {
		this.categorie = categorie;
	}
	/**
	 * @return the categorie
	 */
	public int getCategorie() {
		return categorie;
	}
	/**
	 * @param danger the danger to set
	 */
	public void setDanger(int danger) {
		this.danger = danger;
	}
	/**
	 * @return the danger
	 */
	public int getDanger() {
		return danger;
	}
	/**
	 * @param name the name to set
	 */
	public void setName(String name) {
		this.name = name.trim();
	}
	/**
	 * @return the influence
	 */
	public String getName() {
		return name;
	}
	/**
	 * @param name_ru the name_ru to set
	 */
	public void setName_ru(String name_ru) {
		this.name_ru = name_ru.trim();
	}
	/**
	 * @return the name_ru
	 */
	public String getName_ru() {
		return name_ru;
	}
	/**
	 * @param description the description to set
	 */
	public void setDescription(String description) {
		this.description = description.trim();
	}
	/**
	 * @return the description
	 */
	public String getDescription() {
		return description;
	}
	/**
	 * @param description_ru the description_ru to set
	 */
	public void setDescription_ru(String description_ru) {
		this.description_ru = description_ru.trim();
	}
	/**
	 * @return the description_ru
	 */
	public String getDescription_ru() {
		return description_ru;
	}
	
	@Override
	public String toString(){
		return "E-code: " + code + "\nCategorie: " + categorie +
			"\nDanger: " + danger + "\nName: " +
			name + "\nDescription: " + description;
	}
}
